import {Module, register, SagaGenerator} from "../core-native";
import HomePage from "../pages/HomePage";
import {RootState} from "../types";

class HomeModule extends Module<RootState, "home"> {
    *onEnter(routeParameters: object): SagaGenerator {
        console.log("Home进入之前", routeParameters);
    }
    *onFocus(): SagaGenerator {
        console.log("Home页面onFocus");
    }
    *onBlur(): SagaGenerator {
        console.log("Home页面onBlur");
    }
}

const module = register(new HomeModule("home", {}));
export const HomeActions = module.getActions();
export const Home = module.attachLifecycle(HomePage);
